package com.tjut.controller;

import com.tjut.domain.Enterprise;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
//@RequestMapping("/books")
@RequestMapping("/hello")
public class BookController {

//    @GetMapping("/{id}")
//    public String getById(@PathVariable Integer id){
//        System.out.println("id ==> " + id);
//        return "hello , spring boot!";
//    }



    @GetMapping("")
    public String hello(){
        System.out.println("hello world2223...");
        return "Ok2223...!";
    }
//
//    @Value("${lesson}")
//    private String lesson;//SpringBoot
//
//
//    @Value("${server.port}")//80
//    private Integer port;
//
//    @Value("${enterprise.subject[0]}")//java
//    private String subject_00;
//
//    @Autowired
//    private Environment environment;
//
//    @Autowired
//    private Enterprise enterprise;
//
//
//    @GetMapping("/{id}")
//    public String getById(@PathVariable Integer id) {
//        System.out.println(lesson);
//        System.out.println(port);
//        System.out.println(subject_00);
//        System.out.println("-----------------------");
//
//        System.out.println(environment.getProperty("lesson"));
//        System.out.println(environment.getProperty("server.port"));
//        System.out.println(environment.getProperty("enterprise.age"));
//        System.out.println(environment.getProperty("enterprise.subject[1]"));
//        System.out.println("---------------");
//
//        System.out.println(enterprise);
//        return "hello , springboot";
//    }

}
